---
layout: post
title: Code and the importance of vectorization
date: '2015-05-04T12:07:00.001-07:00'
author: Alex Rogozhnikov
tags:
- RBM
- Python
- numpy
- Neural Networks
- Graphical Models
modified_time: '2015-05-04T12:07:10.229-07:00'
blogger_id: tag:blogger.com,1999:blog-307916792578626510.post-1652987814485965830
blogger_orig_url: http://brilliantlywrong.blogspot.com/2015/05/code-and-importance-of-vectorization.html
---

<p>That awkward moment, when the code written in matlab is easier to read and understand then tons of explanations: <br/>
	<a href="http://www.cs.toronto.edu/~hinton/code/rbm.m">Salakhudinov’s code of RBM</a>
</p>
<p> This code IMHO is a good argument when you need to explain someone that he/she &nbsp;<strong>really</strong>
    needs to&nbsp;learn at&nbsp;least one language or tool with vectorization, no&nbsp;matter whether it&nbsp;is&nbsp;R, matlab, or&nbsp;numpy or&nbsp;theano in&nbsp;python. 
</p>


<p> I also want to note, that vectorization is not a `silver bullet`.
    For example, you can see Friedman's highly optimized fortran
    <a href="https://github.com/dwf/glmnet-python/blob/master/glmnet/glmnet.f">code of GLM</a>
    (Generalized linear models)
</p>
<p>
    Disclaimer: you'll be unable to unsee this.
</p>